package com.codingclub.common.enums;

public enum CategoryType {

    BIG_TYPE(1,"大类"),
    SMALL_TYPE(2,"小类");
    public final int code;
    public final String desc;

    CategoryType(int code , String desc){
        this.code=code;
        this.desc=desc;
    }

    /**
     * 判断是否包含分类code
     * @param code
     * @return
     */
    public static boolean isContainsCode(Integer code) {
        if(code==null){
            return false;
        }
        CategoryType[] values = values();
        for (CategoryType value : values) {
            if(value.code==code){
                return true;
            }
        }
        return false;
    }
}
